package Main;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import Actor.Actor;
import Util.CoordinateUtil;
import View.ViewManager;
import Weapon.PathAI;
import Weapon.PathAIDetail;

public class MyMouseActionListener implements MouseListener {
	private PathAI pathAI;
	private Actor charactor;
	ViewManager manager;
	PathAIDetail pathAI1;
	public MyMouseActionListener(PathAI _pathAI,Actor _actor,ViewManager _manager,PathAIDetail _pathAI1){
		pathAI = _pathAI;
		charactor = _actor;
		manager = _manager;
		pathAI1 = _pathAI1;
	}
	@Override
	public void mouseClicked(MouseEvent e) {

	}

	@Override
	public void mousePressed(MouseEvent e) {
		int selfx = charactor.getX()/10 ;
		int selfy = charactor.getY()/10 ;
		int targetx = manager.getTestx()/10+ CoordinateUtil.twoDXToIsoX(((e.getPoint().x -Constant.frameHeight)/ Constant.tileHeight) ,
						e.getPoint().y / Constant.tileHeight) ;
		int targety = manager.getTesty()/10+ CoordinateUtil.twoDYToIsoY(((e.getPoint().x -Constant.frameHeight)/ Constant.tileHeight) ,
						e.getPoint().y / Constant.tileHeight) ;

		pathAI.addPath(selfx,selfy,targetx,targety);
		

		pathAI1.addPath(selfx, selfy, targetx, targety);
	}

	@Override
	public void mouseReleased(MouseEvent e) {

	}

	@Override
	public void mouseEntered(MouseEvent e) {

	}

	@Override
	public void mouseExited(MouseEvent e) {

	}

}
